<template>
    <div>
      <div class="ba_f outmain">
        <div class="shuju_title mar_b20">
          <div class="shuju_title_text">
            <span>账户概况</span>
          </div>
        </div>
<!--        <div class="ba_f8 pad_20">-->
<!--          <div class="lh25 msgtext fon_12">-->
<!--            温馨提示：以下情况均在用户微信支付情况下生效，余额支付的订单金额统计到账户余额中，需要门店手动申请提现；<br>-->
<!--            1、如门店开启了子商户号功能，微信支付的订单金额直接入账到子商户账户中，不统计到账户余额中并且平台无法进行抽佣；<br>-->
<!--            2、如门店开启了子商户+分账功能，微信支付的订单金额扣除平台佣金后入账到子商户账户中，平台佣金比例以微信服务商设置的最高比例为准，注意抽佣比例最高不能超过总金额的30%。<br>-->
<!--            3、如订单在某些情况下无法完成自动分账或订单冻结，需要手动点击完结分账后，此订单分账金额才能入账到子商户账户中。-->
<!--          </div>-->
<!--        </div>-->
        <div class="main-icon flex t_l mar_t20">
          <div class="flex-1 t_l pad_20 borderBG mar_r20">
            <div class="flex-bet flex-y-top">
              <div>
                <p class="color_9 fon_14">营业总额(元)</p>
                <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.allMoney || 0}}</p>
              </div>
            </div>
          </div>
          <div class="flex-1 t_l pad_20 borderBG mar_r20">
            <div class="flex-bet flex-y-top">
              <div>
                <p class="color_9 fon_14">预计收入(元)</p>
                <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.allEstimate || 0}}</p>
              </div>
            </div>
          </div>
          <div class="flex-1 t_l pad_20 borderBG mar_r20">
            <div class="flex-bet flex-y-top">
              <div>
                <p class="color_9 fon_14">有效订单(单)</p>
                <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.allEffective || 0}}</p>
              </div>
            </div>
          </div>
          <div class="flex-1 t_l pad_20 borderBG">
            <div class="flex-bet flex-y-top">
              <div>
                <p class="color_9 fon_14">无效订单(单)</p>
                <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.allInvalidCount || 0}}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
        <div class="ba_f outmain mar_t20">
            <div class="shuju_title">
                <div class="shuju_title_text">
                    <span>交易概况</span>
                </div>
                <div class="fon_14 ab r0 mar_r10 color_9">查询日期：{{time}}</div>
            </div>
          <div class="mar_t20">
            <el-tabs v-model="activeName1" type="card" @tab-click="handleTabClick">
              <el-tab-pane label="外卖统计" name="wmtj"></el-tab-pane>
              <el-tab-pane label="店内统计" name="dntj"></el-tab-pane>
              <el-tab-pane label="当面付统计" name="dmftj"></el-tab-pane>
            </el-tabs>
          </div>
            <div class="main-icon flex t_l mar_t20">
              <div class="flex-1 t_l pad_20 borderBG mar_r20">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">营业总额</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.money || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastMoney || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreMoney || 0}} </p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="flex-1 t_l pad_20 borderBG mar_r20">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">平台补贴金额</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.subsidy || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastSubsidy || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreSubsidy || 0}} </p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="flex-1 t_l pad_20 borderBG mar_r20">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">平台服务费</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.service || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastService || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreService || 0}} </p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="flex-1 t_l pad_20 borderBG">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">预计收入</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.income || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastIncome || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreIncome || 0}} </p>
                    </div>
                  </div>
<!--                  <div class="toolTip">-->
<!--                    <el-tooltip effect="dark" placement="top">-->
<!--                      <div slot="content" class="tooltext lh25">-->
<!--                        <div>指门店今日收益的金额</div>-->
<!--                        <div class="flex-bet"><p>商品收益：</p>-->
<!--                          <p class="pad_l_30">{{billinfoData.storeGoodsMoney || 0}}</p></div>-->
<!--                        <div class="flex-bet"><p>包装费收益：</p>-->
<!--                          <p>{{billinfoData.storeBoxMoney || 0}}</p></div>-->
<!--                        <div class="flex-bet"><p>配送费收益：</p>-->
<!--                          <p>{{billinfoData.storeDeliveryMoney || 0}}</p></div>-->
<!--                        <div class="flex-bet"><p>其他收益：</p>-->
<!--                          <p>{{billinfoData.otherMoney || 0}}</p></div>-->
<!--                      </div>-->
<!--                      <button type="button"-->
<!--                              class="el-button question-button-tooltip el-tooltip el-button&#45;&#45;text fon_12">-->
<!--                        <span><i class="el-icon-question"></i></span>-->
<!--                      </button>-->
<!--                    </el-tooltip>-->
<!--                  </div>-->
                </div>
              </div>
            </div>
            <div class="main-icon flex t_l mar_t20">
              <div class="flex-1 t_l pad_20 borderBG mar_r20">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">有效订单数</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.effective || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastEffective || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreEffective || 0}} </p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="flex-1 t_l pad_20 borderBG mar_r20">
                <div class="flex-bet flex-y-top">
                  <div>
                    <p class="color_9 fon_14">取消/售后订单</p>
                    <p class="fon_30 title35 lh16 pad_tb_20 wei ">{{billinfoData.refundNum || 0}}</p>
                    <div class="flex">
                      <p class="fon_12 color_9">快餐：{{billinfoData.fastInvalidCount || 0}} </p>
                      <p class="fon_12 color_9 mar_l20">堂食：{{billinfoData.inStoreInvalidCount || 0}} </p>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="main-icon flex t_l mar_t20">
<!--                <div class="flex-1 t_l pad_20  borderBG mar_r20">-->
<!--                    <div class="flex-bet flex-y-top">-->
<!--                        <div>-->
<!--                            <p class="color_9 fon_14">当面付统计</p>-->
<!--                            <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.inStoreCashierData.cashierPay || 0}}</p>-->
<!--                            <p class="fon_12 color_9 lh25">订单数：{{billinfoData.inStoreCashierData.cashierCount || 0}}</p>-->
<!--                            <p class="fon_12 color_9 lh25">支付人数：{{billinfoData.inStoreCashierData.cashierUser || 0}}</p>-->
<!--                        </div>-->
<!--                        <div class="toolTip">-->
<!--                            <el-tooltip effect="dark" placement="top">-->
<!--                                <div slot="content">-->
<!--                                    <div class="lh22">微信支付：{{billinfoData.inStoreCashierData.cashierWxPay || 0}}</div>-->
<!--                                    <div class="lh22">余额支付：{{billinfoData.inStoreCashierData.cashierBalancePay || 0}}</div>-->
<!--                                </div>-->
<!--                                <button type="button"-->
<!--                                        class="el-button question-button-tooltip el-tooltip el-button&#45;&#45;text fon_12">-->
<!--                                    <span><i class="el-icon-question"></i></span>-->
<!--                                </button>-->
<!--                            </el-tooltip>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="flex-1 t_l pad_20 borderBG mar_r20">-->
<!--                    <div class="flex-bet flex-y-top">-->
<!--                        <div>-->
<!--                            <p class="color_9 fon_14">快餐统计</p>-->
<!--                            <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.inStoreFastData.fastPay || 0}}</p>-->
<!--                            <p class="fon_12 color_9 lh25">订单数：{{billinfoData.inStoreFastData.fastCount || 0}}</p>-->
<!--                            <p class="fon_12 color_9 lh25">支付人数：{{billinfoData.inStoreFastData.fastUser || 0}}</p>-->
<!--                        </div>-->
<!--                        <div class="toolTip">-->
<!--                            <el-tooltip effect="dark" placement="top">-->
<!--                                <div slot="content">-->
<!--                                    <div class="lh22">微信支付：{{billinfoData.inStoreFastData.fastWxPay || 0}}</div>-->
<!--                                    <div class="lh22">余额支付：{{billinfoData.inStoreFastData.fastBalancePay || 0}}</div>-->
<!--                                </div>-->
<!--                                <button type="button"-->
<!--                                        class="el-button question-button-tooltip el-tooltip el-button&#45;&#45;text fon_12">-->
<!--                                    <span><i class="el-icon-question"></i></span>-->
<!--                                </button>-->
<!--                            </el-tooltip>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

<!--                <div class="flex-1 t_l pad_20 borderBG mar_r20">-->
<!--                    <div class="flex-bet flex-y-top">-->
<!--                        <div>-->
<!--                            <p class="color_9 fon_14">堂食统计</p>-->
<!--                            <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.inStoreData.instorePay || 0}}</p>-->
<!--                            <div class="flex">-->
<!--                                <p class="fon_12 color_9 lh25">线上订单数：{{billinfoData.inStoreData.instoreCount || 0}}</p>-->
<!--                                <p class="fon_12 color_9 lh25 mar_l30">线下订单数：{{billinfoData.inStoreData.instoreBalanceOfflineCount || 0}}</p>-->
<!--                            </div>-->
<!--                            <div class="flex">-->
<!--                                <p class="fon_12 color_9 lh25">实收金额：{{billinfoData.inStoreData.instoreActualPay || 0}}</p>-->
<!--                                <p class="fon_12 color_9 lh25 mar_l30">营业额：{{billinfoData.inStoreData.instorePay || 0}}</p>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="toolTip">-->
<!--                            <el-tooltip effect="dark" placement="top">-->
<!--                                <div slot="content">-->
<!--                                    <div class="lh22">微信支付：{{billinfoData.inStoreData.instoreWxPay || 0}}</div>-->
<!--                                    <div class="lh22">余额支付：{{billinfoData.inStoreData.instoreBalancePay || 0}}</div>-->
<!--                                    <div class="lh22">线下支付：{{billinfoData.inStoreData.instoreBalanceOfflinePay || 0}}</div>-->
<!--                                </div>-->
<!--                                <button type="button"-->
<!--                                        class="el-button question-button-tooltip el-tooltip el-button&#45;&#45;text fon_12">-->
<!--                                    <span><i class="el-icon-question"></i></span>-->
<!--                                </button>-->
<!--                            </el-tooltip>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

<!--                <div class="flex-1 t_l pad_20 borderBG">-->
<!--                    <div class="flex-bet flex-y-top">-->
<!--                        <div>-->
<!--                            <p class="color_9 fon_14">平台服务费</p>-->
<!--                            <p class="fon_30 title35 lh16 pad_tb_20 wei">{{billinfoData.serviceMoney || 0}}</p>-->
<!--                            <p class="fon_12 color_9 lh25">汇率：{{billinfoData.rate}}</p>-->
<!--                            <p class="fon_12 color_9 lh25" style="color: #fff">汇率：0</p>-->
<!--                        </div>-->
<!--                        <div class="toolTip">-->
<!--                            <el-tooltip effect="dark" placement="top">-->
<!--                                <div slot="content">-->
<!--                                    <div class="lh22">当面付：{{billinfoData.cashierServiceMoney || 0}}</div>-->
<!--                                    <div class="lh22">快餐：{{billinfoData.fastServiceMoney || 0}}</div>-->
<!--                                    <div class="lh22">堂食：{{billinfoData.inStoreServiceMoney || 0}}</div>-->
<!--                                </div>-->
<!--                                <button type="button"-->
<!--                                        class="el-button question-button-tooltip el-tooltip el-button&#45;&#45;text fon_12">-->
<!--                                    <span><i class="el-icon-question"></i></span>-->
<!--                                </button>-->
<!--                            </el-tooltip>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
            </div>
            <div class="ba_f mar_t20">
              <div class="flex-bet">
                <div class="shuju_title mar_b20">
                    <div class="shuju_title_text">
                        <span>订单概况</span>
                    </div>
                </div>
                <div>
                  <a v-if="inActiveName=='2'" :href="handelExport()" class="mar_l10"><el-button  size="medium" type="primary">导出快餐</el-button></a>
                  <a v-if="inActiveName=='3'" :href="handelExport2()" class="mar_l10"><el-button  size="medium" type="primary">导出堂食</el-button></a>
                </div>
              </div>
                <el-tabs v-model="inActiveName" @tab-click="inHandleClick">
<!--                    <el-tab-pane label="当面付" name="1"></el-tab-pane>-->
                    <el-tab-pane label="快餐" name="2"></el-tab-pane>
                    <el-tab-pane label="堂食" name="3"></el-tab-pane>
                </el-tabs>
<!--                <div v-show="inActiveName=='1'">-->
<!--                    <el-table-->
<!--                            v-loading="listLoading"-->
<!--                            :element-loading-text="elementLoadingText"-->
<!--                            :data="list"-->
<!--                            stripe-->
<!--                            style="width: 100%"-->
<!--                            class="mar_t20"-->
<!--                            @selection-change="setSelectRows">-->
<!--                        <el-table-column-->
<!--                                type="selection"-->
<!--                                width="55">-->
<!--                        </el-table-column>-->
<!--&lt;!&ndash;                        <el-table-column&ndash;&gt;-->
<!--&lt;!&ndash;                                prop="portrait"&ndash;&gt;-->
<!--&lt;!&ndash;                                label="用户信息"&ndash;&gt;-->
<!--&lt;!&ndash;                                width="300"&ndash;&gt;-->
<!--&lt;!&ndash;                        >&ndash;&gt;-->
<!--&lt;!&ndash;                            <template slot-scope="scope">&ndash;&gt;-->
<!--&lt;!&ndash;                                <div class="flex flex-y-top">&ndash;&gt;-->
<!--&lt;!&ndash;                                    <div class="">&ndash;&gt;-->
<!--&lt;!&ndash;                                        <img class="goodlogo bor_rad50" :src="scope.row.portrait"/>&ndash;&gt;-->
<!--&lt;!&ndash;                                    </div>&ndash;&gt;-->
<!--&lt;!&ndash;                                    <div class="mar_l10">&ndash;&gt;-->
<!--&lt;!&ndash;                                        <div class="">&ndash;&gt;-->
<!--&lt;!&ndash;                                            <div class="">{{scope.row.userName}}</div>&ndash;&gt;-->
<!--&lt;!&ndash;                                            <div class="fon_12 color_6">用户ID：{{scope.row.userId}}</div>&ndash;&gt;-->
<!--&lt;!&ndash;                                        </div>&ndash;&gt;-->
<!--&lt;!&ndash;                                    </div>&ndash;&gt;-->
<!--&lt;!&ndash;                                </div>&ndash;&gt;-->
<!--&lt;!&ndash;                            </template>&ndash;&gt;-->
<!--&lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                        <el-table-column-->
<!--                                prop="outTradeNo"-->
<!--                                label="订单编号"-->
<!--                        >-->
<!--                        </el-table-column>-->
<!--&lt;!&ndash;                        <el-table-column&ndash;&gt;-->
<!--&lt;!&ndash;                                prop="payAt"&ndash;&gt;-->
<!--&lt;!&ndash;                                label="支付时间"&ndash;&gt;-->
<!--&lt;!&ndash;                        >&ndash;&gt;-->
<!--&lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                        <el-table-column-->
<!--                                prop="money"-->
<!--                                label="应付金额"-->
<!--                        >-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="createdAt"-->
<!--                                label="实付金额"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="color-green wei">+{{scope.row.storeActualMoney}}</div>-->
<!--                                <div class="fon_12">-->
<!--                                  <span>{{scope.row.payModeName}}</span>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--&lt;!&ndash;                        <el-table-column&ndash;&gt;-->
<!--&lt;!&ndash;                                prop="createdAt"&ndash;&gt;-->
<!--&lt;!&ndash;                                label="订单备注"&ndash;&gt;-->
<!--&lt;!&ndash;                        >&ndash;&gt;-->
<!--&lt;!&ndash;                            <template slot-scope="scope">&ndash;&gt;-->
<!--&lt;!&ndash;                                {{scope.row.userNote}}&ndash;&gt;-->
<!--&lt;!&ndash;                            </template>&ndash;&gt;-->
<!--&lt;!&ndash;                        </el-table-column>&ndash;&gt;-->
<!--                      <el-table-column-->
<!--                          prop="zc"-->
<!--                          label="分账操作"-->
<!--                      >-->
<!--                        <template slot-scope="scope">-->
<!--                          <div class="flex">-->
<!--                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '1'">已分账</span>-->
<!--                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '2'">已完结分账</span>-->
<!--                            &lt;!&ndash;                             <span style="color: #489620" v-if="scope.row.state == '51'">立即分账</span>&ndash;&gt;-->
<!--                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '3'">-->
<!--                                 <el-button type="text" @click="handelfz(scope.row.orderId)">完结分账</el-button>-->
<!--                             </span>-->
<!--                            <span v-show="scope.row.profitSharingMsgState == '0'">&#45;&#45;</span>-->
<!--                          </div>-->
<!--                        </template>-->
<!--                      </el-table-column>-->
<!--                        <el-table-column-->
<!--                                label="操作"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="flex">-->
<!--                                    <el-button type="text" @click="handleprint(scope.row)">打印</el-button>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--                    </el-table>-->
<!--                    <el-pagination-->
<!--                            background-->
<!--                            layout="prev, pager, next"-->
<!--                            :total="page.total"-->
<!--                            :page-size="page.pagesize"-->
<!--                            :current-page.sync='page.currentPage'-->
<!--                            @current-change="handleCurrentChange">-->
<!--                    </el-pagination>-->
<!--                </div>-->
                <div v-show="inActiveName=='2'">
                    <el-table
                            v-loading="listLoading"
                            :element-loading-text="elementLoadingText"
                            :data="list2"
                            stripe
                            style="width: 100%"
                            class="mar_t20"
                            @selection-change="setSelectRows2">
                        <el-table-column
                                type="selection"
                                width="55">
                        </el-table-column>
                        <el-table-column
                                prop="takeNo"
                                label="订单序号"
                        >
                            <template slot-scope="scope">
                                <div class="fon_12 wei">
                                    <span>#{{scope.row.takeNo}}</span>
                                </div>
                            </template>
                        </el-table-column>
<!--                        <el-table-column-->
<!--                                prop="portrait"-->
<!--                                label="用户信息"-->
<!--                                width="200"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="flex flex-y-top">-->
<!--                                    <div class="">-->
<!--                                        <img class="goodlogo bor_rad50" :src="scope.row.portrait"/>-->
<!--                                    </div>-->
<!--                                    <div class="mar_l10">-->
<!--                                        <div class="">-->
<!--                                            <div class="">{{scope.row.userName}}</div>-->
<!--                                            <div class="fon_12 color_6">用户ID：{{scope.row.userId}}</div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="outTradeNo"-->
<!--                                label="订单号"-->
<!--                                width="260"-->
<!--                        >-->
<!--                        </el-table-column>-->
                      <el-table-column
                          label="订单来源"
                      >
                        <template slot-scope="scope">
                          <div class="flex">
                            <span v-if="scope.row.origin=='1'"><el-tag effect="dark" size="mini" type="success">微信小程序</el-tag></span>
                            <span v-if="scope.row.origin=='2'"><el-tag effect="dark" size="mini" type="success">微信公众号</el-tag></span>
                            <span v-if="scope.row.origin=='3'"><el-tag effect="dark" size="mini" type="info">支付宝小程序</el-tag></span>
                            <span v-if="scope.row.origin=='4'"><el-tag effect="dark" size="mini" type="danger">百度小程序</el-tag></span>
                            <span v-if="scope.row.origin=='5'"><el-tag effect="dark" size="mini">收银台下单</el-tag></span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="originMoney"
                          label="应收金额"
                      >
                      </el-table-column>
                      <el-table-column
                          prop="discountMoney"
                          label="优惠金额"
                      >
                      </el-table-column>
                        <el-table-column
                                prop="money"
                                label="实付金额"
                        >
                          <template slot-scope="scope">
                            <div class="color-green wei">+￥{{scope.row.money}}</div>
                            <div class="fon_12">
                              <span>{{scope.row.payModeName}}</span>
                            </div>
                          </template>
                        </el-table-column>
                      <el-table-column
                          prop="serviceMoney"
                          label="平台服务费"
                      >
                        <template slot-scope="scope">
                          <div class="color-red wei">-￥{{scope.row.serviceMoney}}</div>
                        </template>
                      </el-table-column>
                        <el-table-column
                                prop="payModeName"
                                label="预计收入"
                        >
                            <template slot-scope="scope">
                                <div class="color-green wei">+￥{{scope.row.storeActualMoney}}</div>
                            </template>
                        </el-table-column>
<!--                        <el-table-column-->
<!--                                prop="money"-->
<!--                                label="就餐方式"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="fon_12">-->
<!--                                    <span v-show="scope.row.isOut=='1'"><el-tag type="success" size="mini">店内就餐</el-tag></span>-->
<!--                                    <span v-show="scope.row.isOut=='2'"><el-tag size="mini">打包带走</el-tag></span>-->
<!--                                </div>-->
<!--                                <div class="fon_12">就餐人数：{{scope.row.people}}</div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="userNote"-->
<!--                                label="订单备注"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                {{scope.row.userNote}}-->
<!--                            </template>-->
<!--                        </el-table-column>-->
                      <el-table-column
                          prop="state"
                          label="订单状态"
                      >
                        <template slot-scope="scope">
                          <div class="color-red" v-if="scope.row.state=='2'"><el-tag type="dager" size="mini">待接单</el-tag></div>
                          <div class="color-orange" v-if="scope.row.state=='3'"><el-tag type="warning" size="mini">制作中</el-tag></div>
                          <div class="color-green" v-if="scope.row.state=='4'"><el-tag type="success" size="mini">已完成</el-tag></div>
                          <div class="color_9" v-if="scope.row.state=='5'"><el-tag type="info" size="mini">已取消</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='6'"><el-tag type="dager" size="mini">申请退款</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='7' && scope.row.refundType=='1'"><el-tag type="info" size="mini">用户申请退款通过</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='7' && scope.row.refundType=='2'"><el-tag type="info" size="mini">商家退款</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='8'"><el-tag type="info" size="mini">拒绝退款</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='9'"><el-tag type="info" size="mini">商户拒单并退款</el-tag></div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="zc"
                          label="分账操作"
                      >
                        <template slot-scope="scope">
                          <div class="flex">
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '1'">已分账</span>
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '2'">已完结分账</span>
                            <!--                             <span style="color: #489620" v-if="scope.row.state == '51'">立即分账</span>-->
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '3'">
                                 <el-button type="text" @click="handelfz(scope.row.orderId)">完结分账</el-button>
                             </span>
                            <span v-show="scope.row.profitSharingMsgState == '0'">--</span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="zc"
                          label="操作"
                      >
                        <template slot-scope="scope">
                          <div class="flex">
                            <el-button type="text" @click="handelDetail(scope.row.outTradeNo,3)">查看详情</el-button>
                          </div>
                        </template>
                      </el-table-column>
<!--                        <el-table-column-->
<!--                                label="操作"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="flex">-->
<!--                                    <el-button type="text" @click="handleprint2(scope.row)">打印</el-button>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
                    </el-table>
                    <el-pagination
                            background
                            layout="prev, pager, next"
                            :total="page2.total"
                            :page-size="page2.pagesize"
                            :current-page.sync='page2.currentPage'
                            @current-change="handleCurrentChange2">
                    </el-pagination>
                </div>
                <div v-show="inActiveName=='3'">
                    <el-table
                            v-loading="listLoading"
                            :element-loading-text="elementLoadingText"
                            :data="list3"
                            stripe
                            style="width: 100%"
                            class="mar_t20"
                            @selection-change="setSelectRows3">
                        <el-table-column
                                type="selection"
                                width="55">
                        </el-table-column>
                        <el-table-column
                                prop="takeNo"
                                label="订单序号"
                        >
                            <template slot-scope="scope">
                                <div class="fon_12">
                                    <span>#{{scope.row.takeNo}}</span>
                                </div>
                            </template>
                        </el-table-column>
<!--                        <el-table-column-->
<!--                                prop="portrait"-->
<!--                                label="用户信息"-->
<!--                                width="200"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="flex flex-y-top">-->
<!--                                    <div class="">-->
<!--                                        <img class="goodlogo bor_rad50" :src="scope.row.portrait"/>-->
<!--                                    </div>-->
<!--                                    <div class="mar_l10">-->
<!--                                        <div class="">-->
<!--                                            <div class="">{{scope.row.userName}}</div>-->
<!--                                            <div class="fon_12 color_6">用户ID：{{scope.row.userId}}</div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="outTradeNo"-->
<!--                                label="订单号"-->
<!--                                width="260"-->
<!--                        >-->
<!--                        </el-table-column>-->
                        <el-table-column
                            label="订单来源"
                        >
                          <template slot-scope="scope">
                            <div class="flex">
                              <span v-if="scope.row.origin=='1'"><el-tag effect="dark" size="mini" type="success">微信小程序</el-tag></span>
                              <span v-if="scope.row.origin=='2'"><el-tag effect="dark" size="mini" type="success">微信公众号</el-tag></span>
                              <span v-if="scope.row.origin=='3'"><el-tag effect="dark" size="mini" type="info">支付宝小程序</el-tag></span>
                              <span v-if="scope.row.origin=='4'"><el-tag effect="dark" size="mini" type="danger">百度小程序</el-tag></span>
                              <span v-if="scope.row.origin=='5'"><el-tag effect="dark" size="mini">收银台下单</el-tag></span>
                            </div>
                          </template>
                        </el-table-column>
                      <el-table-column
                          prop="originMoney"
                          label="应收金额"
                      >
                      </el-table-column>
                      <el-table-column
                          prop="discountMoney"
                          label="优惠金额"
                      >
                      </el-table-column>
                        <el-table-column
                                prop="createdAt"
                                label="实付金额"
                        >
                            <template slot-scope="scope">
                                <div class="color-green wei">+{{scope.row.storeActualMoney}}</div>
                                <div class="fon_12">
                                    <span>{{scope.row.payModeName}}</span>
                                </div>
                            </template>
                        </el-table-column>
                      <el-table-column
                          prop="serviceMoney"
                          label="平台服务费"
                      >
                        <template slot-scope="scope">
                          <div class="color-red wei">-￥{{scope.row.serviceMoney}}</div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="payModeName"
                          label="预计收入"
                      >
                        <template slot-scope="scope">
                          <div class="color-green wei">+￥{{scope.row.storeActualMoney}}</div>
                        </template>
                      </el-table-column>
<!--                        <el-table-column-->
<!--                                prop="people"-->
<!--                                label="就餐人数"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="fon_12">-->
<!--                                  {{scope.row.people}}人-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="userNote"-->
<!--                                label="订单备注"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                {{scope.row.userNote}}-->
<!--                            </template>-->
<!--                        </el-table-column>-->
                      <el-table-column
                          prop="state"
                          label="订单状态"
                      >
                        <template slot-scope="scope">
                          <div class="color-green"
                               v-if="(scope.row.state=='3' && scope.row.eatType=='1') || (scope.row.state=='3' && scope.row.eatType=='2')">
                            <el-tag type="success" size="mini">已完成</el-tag>
                          </div>
                          <div class="color-orange"
                               v-if="(scope.row.state=='2' && scope.row.eatType=='1') || (scope.row.state=='2' && scope.row.eatType=='2')">
                            <el-tag type="warning" size="mini">就餐中</el-tag>
                          </div>
                          <div class="color-red" v-if="scope.row.state=='1' && scope.row.eatType=='1'"><el-tag type="dager" size="mini">待付款</el-tag></div>
                          <div class="color-red" v-if="scope.row.state=='1' && scope.row.eatType=='2'"><el-tag type="dager" size="mini">待接单</el-tag></div>
                          <div class="color_9" v-if="scope.row.state=='4'"><el-tag type="info" size="mini">已取消</el-tag></div>
                          <div class="color_9" v-if="scope.row.state=='5'"><el-tag type="info" size="mini">已退款</el-tag></div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="zc"
                          label="分账操作"
                      >
                        <template slot-scope="scope">
                          <div class="flex">
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '1'">已分账</span>
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '2'">已完结分账</span>
                            <!--                             <span style="color: #489620" v-if="scope.row.state == '51'">立即分账</span>-->
                            <span style="color: #489620" v-show="scope.row.profitSharingMsgState == '3'">
                                 <el-button type="text" @click="handelfz(scope.row.orderId)">完结分账</el-button>
                             </span>
                            <span v-show="scope.row.profitSharingMsgState == '0'">--</span>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column
                          prop="zc"
                          label="操作"
                      >
                        <template slot-scope="scope">
                          <div class="flex">
                            <el-button type="text" @click="handelDetail(scope.row.outTradeNo,2)">查看详情</el-button>
                          </div>
                        </template>
                      </el-table-column>
<!--                        <el-table-column-->
<!--                                label="操作"-->
<!--                        >-->
<!--                            <template slot-scope="scope">-->
<!--                                <div class="flex">-->
<!--                                    <el-button type="text" @click="handleprint3(scope.row)">打印</el-button>-->
<!--                                </div>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
                    </el-table>
                    <el-pagination
                            background
                            layout="prev, pager, next"
                            :total="page3.total"
                            :page-size="page3.pagesize"
                            :current-page.sync='page3.currentPage'
                            @current-change="handleCurrentChange3">
                    </el-pagination>
                </div>
            </div>
        </div>
        <edit ref="edit"></edit>
    </div>
</template>
<script>
import {inStoreBillInfo, billInStoreOrderInfo, billInfo, profitSharingFinish,} from "@/api/statistics";
import {cashierPrint,modifyFastOrder,modifyInStoreOrder} from "@/api/instore";
import index from "@/api";
import {changeDate} from "@/utils";
import Edit from "./components/seeDetail";

    export default {
      components: {Edit},
        created() {
            if (this.$route.query.time) {
                this.time = this.$route.query.time
                this.storeId = this.$route.query.storeId
                this.inStoreBillInfo();
                this.billInStoreOrderInfo2()
            }
        },
        data() {
            return {
                activeName1: 'dntj',
                inActiveName: '2',
                time: '',
                storeId: '',
                billinfoData: {
                    inStoreCashierData:{},
                    inStoreFastData:{},
                    inStoreData:{},
                },
                accountInfo:{},
                list: [],
                list2: [],
                list3: [],
                listLoading: false,
                selectRows: "",
                selectRows2: "",
                selectRows3: "",
                elementLoadingText: "正在加载...",
                page: {
                    total: 0,
                    size: 10,
                    currentPage: 1,
                },
                page2: {
                    total: 0,
                    size: 10,
                    currentPage: 1,
                },
                page3: {
                    total: 0,
                    size: 10,
                    currentPage: 1,
                },
            }
        },
        methods: {
          handleTabClick(){
            if(this.activeName1 == 'wmtj') {
              this.$router.push(`/financerecordDetail?time=${this.time}&storeId=${this.storeId}`);
            }else if(this.activeName1 == 'dntj'){
              this.$router.push(`/infinancerecordDetail?time=${this.time}&storeId=${this.storeId}`);
            }else if(this.activeName1 == 'dmftj'){
              this.$router.push(`/cashfinancerecordDetail?time=${this.time}&storeId=${this.storeId}`);
            }
          },
            async inStoreBillInfo() {
                if (this.time) {
                    const {data} = await billInfo({'time': this.time,storeId:this.storeId,type:'2'});
                    this.billinfoData = data
                }
            },
            inHandleClick(){
                if(this.inActiveName == '1') {
                    this.billInStoreOrderInfo()
                }else if(this.inActiveName == '2'){
                    this.billInStoreOrderInfo2()
                }else if(this.inActiveName == '3'){
                    this.billInStoreOrderInfo3()
                }
            },
            async billInStoreOrderInfo(){
                const {data,count}=await billInStoreOrderInfo({'time': this.time,page: this.page.currentPage,storeId:this.storeId,type:'1'})
                this.list = data;
                this.page.total = count;
            },
            async billInStoreOrderInfo2(){
                const {data,count}=await billInStoreOrderInfo({'time': this.time,page: this.page2.currentPage,storeId:this.storeId,type:'2'})
                this.list2 = data;
                this.page2.total = count;
            },
            async billInStoreOrderInfo3(){
                const {data,count}=await billInStoreOrderInfo({'time': this.time,page: this.page3.currentPage,storeId:this.storeId,type:'3'})
                this.list3 = data;
                this.page3.total = count;
            },
            handleCurrentChange(val) {
                this.page.currentPage = val;
                this.billInStoreOrderInfo()
            },
            handleCurrentChange2(val) {
                this.page2.currentPage = val;
                this.billInStoreOrderInfo2()
            },
            handleCurrentChange3(val) {
                this.page3.currentPage = val;
                this.billInStoreOrderInfo3()
            },
            setSelectRows(val) {
                this.selectRows = val;
            },
            setSelectRows2(val) {
                this.selectRows2 = val;
            },
            setSelectRows3(val) {
                this.selectRows3 = val;
            },
          async handelfz(orderId){
            const {msg} = await profitSharingFinish({orderId,type:'2'});
            this.$baseMessage(msg, "success");
            this.getBillOrderInfo();
          },
            async handleprint(row){
                if(row.orderId){
                    const {msg} = await cashierPrint({orderId:row.orderId});
                    this.$baseMessage(msg, "success");
                    this.billInStoreOrderInfo()
                }else {
                    this.$baseMessage('订单错误', "error");
                }
            },
            async handleprint2(row){
                if(row.orderId){
                    const {msg} = await modifyFastOrder({orderId:row.orderId,type:'print'});
                    this.$baseMessage(msg, "success");
                    this.billInStoreOrderInfo2()
                }else {
                    this.$baseMessage('订单错误', "error");
                }
            },
            async handleprint3(row){
                if(row.orderId){
                    const {msg} = await modifyInStoreOrder({orderId:row.orderId,type:'print'});
                    this.$baseMessage(msg, "success");
                    this.billInStoreOrderInfo3()
                }else {
                    this.$baseMessage('订单错误', "error");
                }
            },
          handelExport() {
            let backendPath = index.backendPath;
            return backendPath + 'channel/store-bill/bill-in-store-order-info?action=export' + '&page=' + this.page2.currentPage + '&time'+this.time + '&storeId=' + this.storeId + '&type=2';
          },
          handelExport2() {
            let backendPath = index.backendPath;
            return backendPath + 'channel/store-bill/bill-in-store-order-info?action=export' + '&page=' + this.page3.currentPage + '&time'+this.time + '&storeId=' + this.storeId + '&type=3';
          },
          handelDetail(outTradeNo,type){
            if (outTradeNo) {
              this.$refs["edit"].showEdit(outTradeNo,type);
            }
          },
    }
    }
</script>
